var type = ["再来一次吧","WHO KNOW？","饺子","炒菜","老胜香包子","黄焖鸡米饭","贝克汉堡","沙县小吃"]
var pars = {
    rotateNum: 8,
    body: '.wrapper',
    clickCb: clickCbFun,
    renderCb: renderCbFun
}
var lottery = new Lottery(pars);
function clickCbFun() {
    var random = Math.floor(Math.random() * 360);
    lottery.goRotate(random);
}
function renderCbFun(deg) {
    var str = '';
    console.log(Math.floor(deg/45));
    var this_type = 7 - Math.floor(deg/45);
    alert(type[this_type]);
}
(function transform_p(){
	
	var str  = "";
	for(var j=0;j<type.length;j++){
		str += "<p>"+type[j]+"</p>"
	}
	$(str).appendTo($(".box"));
	for(var i=0;i<8;i++){
		var deg_ = -67.5 + 45*i;
		console.log(deg_);
		$(".box p").eq(i).css("transform","rotateZ("+ deg_ +"deg)");
	}
})()
